import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace RefHotelBookingApi {
  /** 酒店预订信息 */
  export interface RefHotelBooking {
    id: number; // 
    bookingId?: string; // 预订ID
    orderId: string; // 关联订单ID
    roomId?: string; // 房间ID
    customerId?: string; // 客户ID
    checkInDate?: string | Dayjs; // 入住日期
    checkOutDate?: string | Dayjs; // 退房日期
    roomPrice: number; // 房价
    status: string; // 预订状态
  }
}

/** 查询酒店预订分页 */
export function getRefHotelBookingPage(params: PageParam) {
  return requestClient.get<PageResult<RefHotelBookingApi.RefHotelBooking>>('/wedding/ref-hotel-booking/page', { params });
}

/** 查询酒店预订详情 */
export function getRefHotelBooking(id: number) {
  return requestClient.get<RefHotelBookingApi.RefHotelBooking>(`/wedding/ref-hotel-booking/get?id=${id}`);
}

/** 新增酒店预订 */
export function createRefHotelBooking(data: RefHotelBookingApi.RefHotelBooking) {
  return requestClient.post('/wedding/ref-hotel-booking/create', data);
}

/** 修改酒店预订 */
export function updateRefHotelBooking(data: RefHotelBookingApi.RefHotelBooking) {
  return requestClient.put('/wedding/ref-hotel-booking/update', data);
}

/** 删除酒店预订 */
export function deleteRefHotelBooking(id: number) {
  return requestClient.delete(`/wedding/ref-hotel-booking/delete?id=${id}`);
}


/** 导出酒店预订 */
export function exportRefHotelBooking(params: any) {
  return requestClient.download('/wedding/ref-hotel-booking/export-excel', { params });
}

